﻿/// <reference path="_namespace.js" />
/// <reference path="IDisposable.js" />
/// <reference path="IGetEvent.js" />
/// <reference path="IPreInitialize.js" />

/*****************************************************************************
Ajax library class definition. Kevin Robinson 2006.
Class: ajax.BaseObject
/*****************************************************************************/


// Definition of the base object from which all other objects will derrive.
// Except for the ContentLoader...
ajax.lang.addNamespace("ajax");

//-----------------------------------------------------------------------------
ajax.BaseObject = function()
{    
}; // Constructor
ajax.lang.extend("ajax.BaseObject", "");
ajax.lang.supports("ajax.BaseObject", "ajax.IDisposable");
ajax.lang.supports("ajax.BaseObject", "ajax.IGetEvent");
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
ajax.BaseObject.prototype.getEvent = function(wind, eventType)
{
    ///<summary>Returns the existing or new event router (delegate) for the event name.</summary>
    ///<returns type="ajax.events.EventRouter"></returns>
    ///<param name="wind" type="Window">A window handle</param>
    ///<param name="eventType" type="String">The string name of the event</param>
    var router = ajax.lang.safeCall("ajax.events.EventRouter", "getEvent", wind, this, eventType);        
    return router;                    
}

//-----------------------------------------------------------------------------
ajax.BaseObject.prototype.copyProperties = function(target, style, bPreserve)
{
    return ajax.lang.copyProperties(target, style, bPreserve);
};

//-----------------------------------------------------------------------------
ajax.BaseObject.prototype.isDisposed = false;
ajax.BaseObject.prototype.dispose = function(){ this.isDisposed = true; };

//-----------------------------------------------------------------------------
ajax.BaseObject.prototype.toString = function()
{
    return "ajax.BaseObject";    
}

//-----------------------------------------------------------------------------
ajax.BaseObject.prototype.toClassName = function()
{
    return ajax.lang.getClassName("ajax.BaseObject");
}

ajax.BaseObject.cast = function(obj)
{///<returns type="ajax.BaseObject" />
    return obj;
}

